#!/bin/bash -e
# $File: genjs
# $Date: Thu Feb 16 13:05:16 2012 +0800
# $Author: jiakai <jia.kai66@gmail.com>

UGLIFY_DIR=$(pwd)/3rd-party/uglifyjs
WORKDIR='pynojo/view/static'

find $WORKDIR/js -type f -name "*.js" | xargs $(which cat) | \
	if [ "$1" == "-d" ]
	then
		cat 
	else
		echo "tip: use -d to disable minifying" > /dev/stderr
		export NODE_PATH=$UGLIFY_DIR
		$UGLIFY_DIR/bin/uglifyjs -nc
	fi \
	> $WORKDIR/pynojo_all.js
# vim: ft=sh
